<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>Frequently Asked Questions &mdash; Requests 2.3.0 documentation</title>
    
    <link rel="stylesheet" href="../_static/flasky.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../',
        VERSION:     '2.3.0',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../_static/jquery.js"></script>
    <script type="text/javascript" src="../_static/underscore.js"></script>
    <script type="text/javascript" src="../_static/doctools.js"></script>
    <link rel="top" title="Requests 2.3.0 documentation" href="../index.html" />
    <link rel="next" title="Integrations" href="out-there.html" />
    <link rel="prev" title="Authentication" href="../user/authentication.html" />
   
  
  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
  <script type="text/javascript" src="https://gumroad.com/js/gumroad.js"></script>

  </head>
  <body>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="out-there.html" title="Integrations"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="../user/authentication.html" title="Authentication"
             accesskey="P">previous</a> |</li>
        <li><a href="../index.html">Requests 2.3.0 documentation</a> &raquo;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="frequently-asked-questions">
<span id="faq"></span><h1>Frequently Asked Questions<a class="headerlink" href="#frequently-asked-questions" title="Permalink to this headline">¶</a></h1>
<p>This part of the documentation answers common questions about Requests.</p>
<div class="section" id="encoded-data">
<h2>Encoded Data?<a class="headerlink" href="#encoded-data" title="Permalink to this headline">¶</a></h2>
<p>Requests automatically decompresses gzip-encoded responses, and does
its best to decode response content to unicode when possible.</p>
<p>You can get direct access to the raw response (and even the socket),
if needed as well.</p>
</div>
<div class="section" id="custom-user-agents">
<h2>Custom User-Agents?<a class="headerlink" href="#custom-user-agents" title="Permalink to this headline">¶</a></h2>
<p>Requests allows you to easily override User-Agent strings, along with
any other HTTP Header.</p>
</div>
<div class="section" id="why-not-httplib2">
<h2>Why not Httplib2?<a class="headerlink" href="#why-not-httplib2" title="Permalink to this headline">¶</a></h2>
<p>Chris Adams gave an excellent summary on
<a class="reference external" href="http://news.ycombinator.com/item?id=2884406">Hacker News</a>:</p>
<blockquote>
<div><p>httplib2 is part of why you should use requests: it&#8217;s far more respectable
as a client but not as well documented and it still takes way too much code
for basic operations. I appreciate what httplib2 is trying to do, that
there&#8217;s a ton of hard low-level annoyances in building a modern HTTP
client, but really, just use requests instead. Kenneth Reitz is very
motivated and he gets the degree to which simple things should be simple
whereas httplib2 feels more like an academic exercise than something
people should use to build production systems[1].</p>
<p>Disclosure: I&#8217;m listed in the requests AUTHORS file but can claim credit
for, oh, about 0.0001% of the awesomeness.</p>
<p>1. <a class="reference external" href="http://code.google.com/p/httplib2/issues/detail?id=96">http://code.google.com/p/httplib2/issues/detail?id=96</a> is a good example:
an annoying bug which affect many people, there was a fix available for
months, which worked great when I applied it in a fork and pounded a couple
TB of data through it, but it took over a year to make it into trunk and
even longer to make it onto PyPI where any other project which required &#8221;
httplib2&#8221; would get the working version.</p>
</div></blockquote>
</div>
<div class="section" id="python-3-support">
<h2>Python 3 Support?<a class="headerlink" href="#python-3-support" title="Permalink to this headline">¶</a></h2>
<p>Yes! Here&#8217;s a list of Python platforms that are officially
supported:</p>
<ul class="simple">
<li>Python 2.6</li>
<li>Python 2.7</li>
<li>Python 3.1</li>
<li>Python 3.2</li>
<li>Python 3.3</li>
<li>Python 3.4</li>
<li>PyPy 1.9</li>
<li>PyPy 2.2</li>
</ul>
</div>
<div class="section" id="what-are-hostname-doesn-t-match-errors">
<h2>What are &#8220;hostname doesn&#8217;t match&#8221; errors?<a class="headerlink" href="#what-are-hostname-doesn-t-match-errors" title="Permalink to this headline">¶</a></h2>
<p>These errors occur when <a class="reference internal" href="../user/advanced.html#verification"><em>SSL certificate verification</em></a>
fails to match the certificate the server responds with to the hostname
Requests thinks it&#8217;s contacting. If you&#8217;re certain the server&#8217;s SSL setup is
correct (for example, because you can visit the site with your browser) and
you&#8217;re using Python 2.6 or 2.7, a possible explanation is that you need
Server-Name-Indication.</p>
<p><a class="reference external" href="https://en.wikipedia.org/wiki/Server_Name_Indication">Server-Name-Indication</a>, or SNI, is an official extension to SSL where the
client tells the server what hostname it is contacting. This is important
when servers are using <a class="reference external" href="https://en.wikipedia.org/wiki/Virtual_hosting">Virtual Hosting</a>. When such servers are hosting
more than one SSL site they need to be able to return the appropriate
certificate based on the hostname the client is connecting to.</p>
<p>Python3&#8217;s SSL module includes native support for SNI. This support has not been
back ported to Python2. For information on using SNI with Requests on Python2
refer to this <a class="reference external" href="https://stackoverflow.com/questions/18578439/using-requests-with-tls-doesnt-give-sni-support/18579484#18579484">Stack Overflow answer</a>.</p>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper"><p class="logo">
  <a href="../index.html">
    <img class="logo" src="../_static/requests-sidebar.png" title="Rezzy the Requests Sea Turtle"/>
  </a>
</p>
<p>
<iframe src="http://ghbtns.com/github-btn.html?user=kennethreitz&repo=requests&type=watch&count=true&size=large"
  allowtransparency="true" frameborder="0" scrolling="0" width="200px" height="35px"></iframe>
</p>

<p>
  Requests is an elegant and simple HTTP library for Python, built for
  human beings. You are currently looking at the documentation of the
  development release.
</p>


<h3>Donate</h3>
 <p>
     If you love Requests, consider supporting the author <a href="https://www.gittip.com/kennethreitz/">on Gittip</a>:
 </p>
 <p>
   <iframe style="border: 0; margin: 0; padding: 0;"
       src="https://www.gittip.com/kennethreitz/widget.html"
       width="48pt" height="20pt"></iframe>
 </p>

<h3>Get Updates</h3>
<p>Receive updates on new releases and upcoming projects.</p>

<p><a href="http://tinyletter.com/kennethreitz">Subscribe to Newsletter</a></p>


  <h3><a href="../index.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">Frequently Asked Questions</a><ul>
<li><a class="reference internal" href="#encoded-data">Encoded Data?</a></li>
<li><a class="reference internal" href="#custom-user-agents">Custom User-Agents?</a></li>
<li><a class="reference internal" href="#why-not-httplib2">Why not Httplib2?</a></li>
<li><a class="reference internal" href="#python-3-support">Python 3 Support?</a></li>
<li><a class="reference internal" href="#what-are-hostname-doesn-t-match-errors">What are &#8220;hostname doesn&#8217;t match&#8221; errors?</a></li>
</ul>
</li>
</ul>
<h3>Related Topics</h3>
<ul>
  <li><a href="../index.html">Documentation overview</a><ul>
      <li>Previous: <a href="../user/authentication.html" title="previous chapter">Authentication</a></li>
      <li>Next: <a href="out-there.html" title="next chapter">Integrations</a></li>
  </ul></li>
</ul>
<div id="searchbox" style="display: none">
  <h3>Quick search</h3>
    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="footer">
      &copy; Copyright 2014. A <a href="http://kennethreitz.com/pages/open-projects.html">Kenneth Reitz</a> Project.
    </div>
    <a href="https://github.com/kennethreitz/requests" class="github">
        <img style="position: absolute; top: 0; right: 0; border: 0;" src="http://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub"  class="github"/>
    </a>
    <script type="text/javascript">
    /* <![CDATA[ */
        (function() {
            var s = document.createElement('script'), t = document.getElementsByTagName('script')[0];
            s.type = 'text/javascript';
            s.async = true;
            s.src = 'http://api.flattr.com/js/0.6/load.js?mode=auto';
            t.parentNode.insertBefore(s, t);
        })();
    /* ]]> */
    </script>
        <script type="text/javascript">
    setTimeout(function(){var a=document.createElement("script");
    var b=document.getElementsByTagName("script")[0];
    a.src=document.location.protocol+"//dnn506yrbagrg.cloudfront.net/pages/scripts/0013/7219.js?"+Math.floor(new Date().getTime()/3600000);
    a.async=true;a.type="text/javascript";b.parentNode.insertBefore(a,b)}, 1);
    </script>

    <script type="text/javascript">
        new HelloBar(36402,48802);
    </script>


    <script type="text/javascript">

      var _gaq = _gaq || [];
      _gaq.push(['_setAccount', 'UA-8742933-11']);
      _gaq.push(['_setDomainName', 'none']);
      _gaq.push(['_setAllowLinker', true]);
      _gaq.push(['_trackPageview']);

      (function() {
        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
      })();

    </script>

    <script type="text/javascript">
      (function() {
        var t   = document.createElement('script');
        t.type  = 'text/javascript';
        t.async = true;
        t.id    = 'gauges-tracker';
        t.setAttribute('data-site-id',
                       '4ddc27f6613f5d186d000007');
        t.src = '//secure.gaug.es/track.js';
        var s = document.getElementsByTagName('script')[0];
        s.parentNode.insertBefore(t, s);
      })();
    </script>
  </body>
</html>